# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=govc
pkgver=0.34.1
pkgrel=0
pkgdesc="vSphere CLI built on top of govmomi"
url="https://github.com/vmware/govmomi/blob/main/govc/README.md"
arch="all"
license="Apache-2.0"
makedepends="go bash coreutils"
source="https://github.com/vmware/govmomi/archive/v$pkgver/govc-$pkgver.tar.gz"
builddir="$srcdir/govmomi-$pkgver/govc"
# !check: no tests provided
# net: fetch dependencies
options="!check net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -o "$builddir"/govc .
}

package() {
	install -Dm755 "$builddir"/govc "$pkgdir"/usr/bin/govc
}

sha512sums="
2d88eb22cfbe9dc89b5c9f9402fe3e921624e3292445f4fef5103b71d646b19501ccce0a30758aff4360cc3a3de6f9d71da4c4611b4bedab79845c9b559df418  govc-0.34.1.tar.gz
"
